<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<div class="modal-dialog ms-modal-dialog" style="margin-top:50px;" >
  <div class="modal-content">
     
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
      <h4 class="modal-title">修改课程信息</h4>
    </div>
    
      <form class="form-horizontal ms-form form-personal-info" method="POST" action="${ctx.host}/courses/${id}" data-validate="true">
        
        <input type="hidden" name="_method" value="PATCH" />
        
        <input type="hidden" name="id" value="${id}" />
        
         <div class="modal-body">
             
             <div class="form-group  ms-form-group">
              <label class="control-label col-xs-3">课程编号：</label>
              <div class="col-xs-8 pull-left">
                <p class="form-control-static">${course.code}</p>
              </div>
            </div>
            <div class="form-group  ms-form-group">
	          <label class="control-label col-xs-3"><span class="text-red">*</span>课程名称：</label>
	          <div class="col-xs-8">
	            <input type="text" class="form-control" name="name" value="${course.name}" placeholder="名称" data-validate="required" autocomplete="off" tabindex="1"/>
	          </div>
	        </div>
	        <div class="form-group  ms-form-group">
	          <label class="control-label col-xs-3"><span class="text-red">*</span>课程时长：</label>
	          <div class="col-xs-8">
	            <input type="text" class="form-control" name="hour" value="${course.hour}" placeholder="课程时长" data-validate="required|float|length_between,1,4" autocomplete="off" tabindex="2"/>
	          </div>
	        </div>
            <div class="form-group  ms-form-group">
	          <label class="control-label col-xs-3"><span class="text-red">*</span>课程目标：</label>
	          <div class="col-xs-8">
	            <input type="text" class="form-control" name="target" value="${course.target}" placeholder="课程目标" data-validate="required" autocomplete="off" tabindex="3"/>
	          </div>
	        </div>
            <div class="form-group  ms-form-group">
	          <label class="control-label col-xs-3"><span class="text-red">*</span>课程介绍：</label>
	          <div class="col-xs-8">
	            <input type="text" class="form-control" name="description" value="${course.description}" placeholder="课程介绍" data-validate="required" autocomplete="off" tabindex="3"/>
	          </div>
	        </div>
	        <div class="form-group  ms-form-group">
	          <label class="control-label col-xs-3"><span class="text-red">*</span>讲授次数：</label>
	          <div class="col-xs-8">
	            <input type="text" class="form-control" name="courseTime" value="${course.courseTime}" placeholder="讲授次数" data-validate="required|number|length_between,1,2" autocomplete="off" tabindex="2"/>
	          </div>
	        </div>
	        <div class="form-group  ms-form-group">
	          <label class="control-label col-xs-3"><span class="text-red">*</span>讲师：</label>
	          <div class="col-xs-8">
					<select class="select2 form-control" name="trainer.id" data-validate="required" id="selTrainer" tabindex="7">
		                <c:forEach items="${trainers}" var="trainer">
		                  <option value="${trainer.id}" <c:if test="${ trainer.id == course.trainer.id}">selected</c:if>  >${trainer.name}</option>
		                </c:forEach>
		            </select>	          
	          </div>
	        </div>
	        <div class="form-group  ms-form-group">
	          <label class="control-label col-xs-3"><span class="text-red">*</span>课程性质：</label>
	          <div class="col-xs-8">
					<select class="select2 form-control" name="property" data-validate="required" id="selProperty" tabindex="7">
		                <option value="标准课程"  <c:if test="${ '标准课程'  eq course.property}">selected</c:if> >标准课程</option>
		                <option value="自定义课程"  <c:if test="${ '自定义课程'  eq course.property}">selected</c:if> >自定义课程</option>
		            </select>	          
	          </div>
	        </div>
	        <div class="form-group  ms-form-group">
	          <label class="control-label col-xs-3"><span class="text-red">*</span>课程类型：</label>
	          <div class="col-xs-8">
					<select class="select2 form-control" name="type"  id="selType" tabindex="7">
		                <option  ></option>
		                <option value="管理类"  <c:if test="${ '管理类'  eq course.type}">selected</c:if> >管理类</option>
		                <option value="专业通识类"  <c:if test="${ '专业通识类'  eq course.type}">selected</c:if> >专业通识类</option>
		            </select>	          
	          </div>
	        </div>
        
        </div>
      <div class="modal-footer ms-modal-footer">
        <button type="submit" class="btn btn-shadow-success btn-shadow umu-btn" >确定</button>
        <button type="button" class="btn btn-shadow-default btn-shadow umu-btn" data-dismiss="modal">取消</button>
      </div>

      </form>
    
  </div>
</div>
</div>